<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Homepage</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/jquery.dataTables.css" type="text/css">
<script src="${pageContext.request.contextPath}/resources/scripts/jquery-1.11.1.min.js"></script>
<script src="${pageContext.request.contextPath}/resources/scripts/jquery.dataTables.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $('#table1').dataTable();
} );
function editFood(row){
	var tr = document.getElementById(row);
	var name = tr.getElementsByTagName("td")[0].innerHTML;
	window.open(""+name,"Browse","left=200,top=200,width=700,height=530,toolbar=0,resizable=0");
}
</script>
</head>
<body>
<img alt="" src="${element.image}">
	<table id="table1" class="display" width="100%" cellspacing="0">
	 <thead>
		<tr>
			<th>Name</th>
			<th>Image</th>
			<th>Type</th>
			<th>Source</th>
			<th>Date of purchase</th>
			<th>Wholesale Price</th>
			<th>Retail Price</th>
			<th>Status</th>
			<th>Information</th>
			<th>QR code</th>
		</tr>
		 </thead>
		  <tbody>
		<c:forEach items="${list}" var="element">
				<tr>
					<td><c:out value="${element.name}" /></td>
					<td><img alt="" src="<%=request.getContextPath()%>${element.image}"></td>
					<td><c:out value="${element.type}" /></td>
					<td><c:out value="${element.source}" /></td>
					<td><c:out value="${element.dateOfPurchase}" /></td>
					<td><c:out value="${element.wholesalePrice}" /></td>
					<td><c:out value="${element.retailPrice}" /></td>
					<td><c:out value="${element.status}" /></td>
					<td><c:out value="${element.info}" /></td>
					<td><img alt="" src="<%=request.getContextPath()%>${element.qr}"></td>
				</tr>
			</c:forEach>
	</tbody>
	</table>
	
</body>
</html>